package backstage.product;

import javax.servlet.http.HttpServletRequest;
import org.apache.struts2.ServletActionContext;

public class memberProcess {
    private int id;
    private String Account;
    private String Password;
    private String Name;
    private int Sex;
    private String Birth;
    private String Address;
    private String Phone;
    private String Email;
        
    public String execute() throws Exception {
        String result = "fail";
        
        NWDB.NWDB mydb=new NWDB.NWDB();
        NWDB.IMember im=new NWDB.ImplMember(mydb.getConnection());
        mydb.setIMember(im);
        
        HttpServletRequest request = ServletActionContext.getRequest();
        try {
                /*System.out.println(id);
                System.out.println(Account);
                System.out.println(Sex);
                System.out.println(Birth);*/
                mydb.UpdateAllMember(id, getAccount(), getPassword(), getName(), getSex(), getBirth(), getAddress(), getPhone(), getEmail());
                result = "success";
            } catch (Exception e) {
                result = "fail";
                request.setAttribute("message", "加入失敗，請確認！");
            }
        return result;
    }

    /**
     * @return the id
     */
    public int getId() {
        return id;
    }

    /**
     * @param id the id to set
     */
    public void setId(int id) {
        this.id = id;
    }

    /**
     * @return the Account
     */
    public String getAccount() {
        return Account;
    }

    /**
     * @param Account the Account to set
     */
    public void setAccount(String Account) {
        this.Account = Account;
    }

    /**
     * @return the Password
     */
    public String getPassword() {
        return Password;
    }

    /**
     * @param Password the Password to set
     */
    public void setPassword(String Password) {
        this.Password = Password;
    }

    /**
     * @return the Name
     */
    public String getName() {
        return Name;
    }

    /**
     * @param Name the Name to set
     */
    public void setName(String Name) {
        this.Name = Name;
    }

    /**
     * @return the Sex
     */
    public int getSex() {
        return Sex;
    }

    /**
     * @param Sex the Sex to set
     */
    public void setSex(int Sex) {
        this.Sex = Sex;
    }

    /**
     * @return the Birth
     */
    public String getBirth() {
        return Birth;
    }

    /**
     * @param Birth the Birth to set
     */
    public void setBirth(String Birth) {
        this.Birth = Birth;
    }

    /**
     * @return the Address
     */
    public String getAddress() {
        return Address;
    }

    /**
     * @param Address the Address to set
     */
    public void setAddress(String Address) {
        this.Address = Address;
    }

    /**
     * @return the Phone
     */
    public String getPhone() {
        return Phone;
    }

    /**
     * @param Phone the Phone to set
     */
    public void setPhone(String Phone) {
        this.Phone = Phone;
    }

    /**
     * @return the Email
     */
    public String getEmail() {
        return Email;
    }

    /**
     * @param Email the Email to set
     */
    public void setEmail(String Email) {
        this.Email = Email;
    }


    
    
}
